//
//  OosUserFeedParser.m
//  oos4ios
//
//  Created by Pablo Gonzalez on 4/13/11.
//  Copyright 2011 11870.com. All rights reserved.
//

#import "OosUserFeedParser.h"
#import "../Atom/Feeds/OosUserFeed.h"
#import <oos4ios/Model/OosUser.h>
#import "OosUserEntryParser.h"

@implementation OosUserFeedParser

static OosUserFeedParser *instance;

+ (OosUserFeedParser *)instance
{
    if (!instance) {
        instance = [[OosUserFeedParser alloc] init];
    }
    return instance;
}

- (NSArray *) parseFeed: (OosFeed *) feed
{
    OosUserFeed *userFeed = (OosUserFeed *) feed;
    NSMutableArray *results = [NSMutableArray array];
    OosUserEntryParser *entryParser = [OosUserEntryParser instance];
    for (OosUserEntry *entry in [userFeed entries]) {
        [results addObject: [entryParser parseEntry:entry]];
    }
    return results;
}

@end
